home *** CD-ROM | disk | FTP | other *** search
/ Animation / Animation Vol.1 (Profi ROM)(1994).iso / pool / updates / symantec / rtlinc.exe / TIME.H < prev    next >
C/C++ Source or Header  |  1993-08-14  |  3KB  |  102 lines

  1. /*_ time.h   Sat Jul 15 1989   Modified by: Walter Bright */
  2. /* Copyright (C) 1986-1989 by Walter Bright    */
  3. /* All Rights Reserved                    */
  4. /* Written by Walter Bright                */
  5. /* Date and time support                */
  6. /* $Revision:   1.2  $ */
  7.  
  8. #ifndef __TIME_H
  9. #define __TIME_H    1
  10.  
  11. #if __cplusplus
  12. extern "C" {
  13. #endif
  14.  
  15. typedef unsigned size_t;
  16. #define CLOCKS_PER_SEC    ((clock_t) 100) /* (clock_t / CLOCKS_PER_SEC) == seconds */
  17. #define CLK_TCK ((clock_t) 100) /* (clock_t / CLK_TCK) == seconds    */
  18.  
  19. typedef long clock_t;
  20. #ifndef __TYPES_H
  21. typedef long time_t;
  22. #endif
  23.  
  24. #ifdef __STDC__
  25. #define __CDECL
  26. #define __STDCALL
  27. #else
  28. #define __CDECL __cdecl
  29. #define __STDCALL __stdcall
  30. #endif
  31.  
  32. #if __OS2__ && __INTSIZE == 4
  33. #define __CLIB    __STDCALL
  34. #else
  35. #define __CLIB    __CDECL
  36. #endif
  37.  
  38. /* Structure to contain broken-down time    */
  39. struct tm
  40. {    int    tm_sec,        /* seconds 0..59            */
  41.         tm_min,        /* minutes 0..59            */
  42.         tm_hour,    /* hour of day 0..23            */
  43.         tm_mday,    /* day of month 1..31            */
  44.         tm_mon,        /* month 0..11                */
  45.         tm_year,    /* years since 1900            */
  46.         tm_wday,    /* day of week, 0..6 (Sunday..Saturday) */
  47.         tm_yday,    /* day of year, 0..365            */
  48.         tm_isdst;    /* >0 if daylight savings time        */
  49.                 /* ==0 if not DST            */
  50.                 /* <0 if don't know            */
  51. };
  52.  
  53. #define TIMEOFFSET    315558000    /* Unix time - DOS time        */
  54.  
  55. clock_t __CLIB clock(void);
  56. time_t __CLIB time(time_t *);
  57. time_t __CLIB mktime(struct tm *);
  58. char * __CLIB asctime(const struct tm *);
  59. char * __CLIB ctime(const time_t *);
  60. struct tm * __CLIB localtime(const time_t *);
  61. struct tm * __CLIB gmtime(const time_t *);
  62. size_t __CLIB strftime(char *,size_t,const char *,const struct tm *);
  63. int __CLIB stime(time_t *ptr);
  64. char * __CLIB _strdate(char *dstring);
  65. char * __CLIB _strtime(char *timestr);
  66.  
  67. /* Difference between two time_t's    */
  68. #define difftime(t1,t2)        ((double)((time_t)(t1) - (time_t)(t2)))
  69.  
  70. /* No GMT is available, so just return NULL    */
  71. #define gmtime(a)    ((struct tm *) 0)
  72.  
  73. /* non-ANSI functions    */
  74. #if !__STDC__
  75. #if M_UNIX || M_XENIX
  76.  
  77. /* This is the structure used by long times(struct tms *buf) */
  78. struct tms
  79. {    time_t    tms_utime;    /* user            */
  80.     time_t    tms_stime;    /* system        */
  81.     time_t    tms_cutime;    /* user children    */
  82.     time_t    tms_cstime;    /* system children    */
  83. };
  84.  
  85. unsigned int __CLIB sleep(unsigned int);
  86. long int __CLIB nap(long int mS);
  87. #define usleep(s) (void)nap((s)/1000)
  88. #define msleep(s) (void)nap(s)
  89. #else
  90. void __CLIB sleep(time_t);
  91. void __CLIB usleep(unsigned long);
  92. void __CLIB msleep(unsigned long);
  93. int __CLIB utime(const char *,time_t [2]);
  94. #endif
  95. #endif
  96.  
  97. #if __cplusplus
  98. }
  99. #endif
  100.  
  101. #endif /* __TIME_H */
  102.